import React from "react";
import './index.module.scss';
import { withRouter } from 'react-router-dom';
// import store2 from './../Common/store';
import Test from './test';

class Button extends React.Component {

    constructor(props) {
        super(props);
        console.log("参数");
        console.log(props);
    }

    render() {
        const _this = this;
        const onClick = () => {
            console.log("click");
            console.log(store);

            const _dom = (<div>ok</div>);
            store.getComponent("app", (o) => {
                console.log(o);
                o.setState({
                    dialog: {
                        title: "修改控件类型",
                        content: _dom,
                        onCloseClick: () => {
                            console.log('p close.');
                            return true;
                        }
                    }
                });
            });
            _this.props.history.push("/autoApi/mypage/");
        }

        // console.log("加载input");
        // console.log(this.props.root);
        return (<div className="btn22" onClick={onClick.bind(this)}>dasdaSD<Test /></div>
        )
    }
}
export default withRouter(Button);